package dao

// 这是 UmsMemberReceiveAddress 的全局公开dao对象，被service层调用!
var UmsMemberReceiveAddressDao = umsMemberReceiveAddressDao{}

// 收货地址表
// 这是 ums_member_receive_address表 的实体类
type UmsMemberReceiveAddress struct {
	City          string `json:"city" form:"city" v:"city"`
	DefaultStatus int32  `json:"default_status" form:"default_status" v:"default_status"` // 是否为默认
	DetailAddress string `json:"detail_address" form:"detail_address" v:"detail_address"` // 详细地址(街道)
	Id            int64  `json:"id" form:"id" v:"id"`
	MemberId      int64  `json:"member_id" form:"member_id" v:"member_id"`          // 外键关联 ums_member(id)
	Name          string `json:"name" form:"name" v:"name"`                         // 收货人名称
	PhoneNumber   string `json:"phone_number" form:"phone_number" v:"phone_number"` // 收货人手机号
	PostCode      string `json:"post_code" form:"post_code" v:"post_code"`          // 邮政编码
	Province      string `json:"province" form:"province" v:"province"`             // 省份/直辖市
	Region        string `json:"region" form:"region" v:"region"`                   // 区域

}

// 注意:这是 UmsMemberReceiveAddress 的私有dao对象，只能在dao层内使用!
type umsMemberReceiveAddressDao struct {
	InsertTemplate func(arg UmsMemberReceiveAddress) (int64, error)                               //插入一条记录
	UpdateTemplate func(arg UmsMemberReceiveAddress) (int64, error)                               //更新一条记录
	DeleteTemplate func(id int64) (int64, error)                                                  `args:"id"`                         //根据传入的主键删除一条记录
	SelectTemplate func(id int64) (UmsMemberReceiveAddress, error)                                `args:"id"`                         //根据传入的主键获取一条记录
	List           func(keyword string, pageNum, pageSize int) ([]UmsMemberReceiveAddress, error) `args:"keyword,page_num,page_size"` //模糊分页查询
}

/*
// 这是 ums_member_receive_address 表的Postman测试参数
// 该结构体中的字段就是: 前后端交互的json字段!
type UmsMemberReceiveAddressPostman struct {
city
default_status
detail_address
id
member_id
name
phone_number
post_code
province
region

}*/

// 这是 ums_member_receive_address 表的批量请求参数
type UmsMemberReceiveAddressReq struct {
	List []UmsMemberReceiveAddress `json:"list" form:"list"`
}
